hey what's up guys welcome back to
Gabriella gap prod this time we are
going to see this very cool effect that
I always wanted to recreate which
Telegraph it's basically a shield with
some ripples when it's it lies empty and
I think it's truly awesome it's a little
bit complex this effect but I will try
my best to show you every step I took to
achieve something like this and as
always this project is about my patreon
page in case you are interested I left a
link in the description and you can get
access to many effects and shaders for
your games so with that being said let's
see how we can do this all right so if
we break these into parts these needs a
shield which requires an excellent
pattern mesh an appropriate texture that
fits the UV maps perfectly and then
there's a special shader that as vertex
offset Fresno and a few more things that
we are going to see for the ripples we
can reuse everything except the shader
because it requires a sphere mask and
also needed to create a script that
detects collisions on a sphere Collider
and then there's a few more particle
systems to complement the ball F so
those are the main parts to create this
shield
now for the mesh I use a blender and it
was actually fairly easy to create a
sphere with a hexagon pattern all I had
to do is start with this eco sphere with
a subdivision of three
and the trick now is to turn on tissue
in the add-on settings
and with these hours a
to press this button and transform the
ecosphere into this which was an
enormous time-saver
Zion rapid the mesh I end up with faces
overlapping each other but I needed the
eggs against and the Pentagon's to be
independent
so to separate them I selected all the
pentagon's which are fewer and moved
them a little bit to the side ending
with this UV map now I had to detach
each face so I can move them separately
with the vertex offset in the shader
which led me to splitting the edges then
separate everything by loose parts
cool the mesh is done with the mesh
being done export the UVs and moved on
to create this simple texture in
Photoshop it will basically highlight
the edges of each X again and Pentagon
next step is creating the basis of the
effect basically a particle system
attached to an empty game object which
allowed me to use the mesh I created
in the particle system and assign a
material as a place old for now
now one of the most important parts is
the shader and for the shader I used an
unlit graph which I open in jeddah graph
and make sure it was transparent I also
moved on to set up the basics of the
shader basically a color in HDR mode
with white and full opacity as default
and the main texture for the excellence
and the pentagon's basically the texture
is connected to a sample texture 2d that
will be multiplied with the color
this output will be able to apply with
the vertex offset color in case I want
to use color from the particle system
another cool stuff I could easily add is
a Fresnel effort this will make the
shield glow basically and it adds a
really nice touch
and I can also control the color and the
brightness of the Fresno with another
color property
with the basics of the shader being done
I created a material
and added to the shield particle system
and it was looking like this nothing too
fancy for now but once I adjusted the
values of the main color the Fresnel
intensity
I got this pretty cool effect
and I noticed I had this dark color
which made me realize I forgot switched
blend mode from alpha to additive
and now it looks much better and it's
more appropriate for shield effort
now my next step required vertex offset
so I could make all of the x-games and
Pentagon's move outwards like if the
shield was breathing
and for that I use it the position note
set to object which allowed me now to
add modifications to these original
positions of the vertex
so I use the time note multiplied by
some value that is going to manipulate
the frequency of a sine wave
next if I want this to move outwards I'm
going to need the normal vector which is
a perpendicular vector to each face
and I can multiply this by the amount I
want to extrapolate cool
now all I needed to do was multiply the
normal vector with the sine wave and add
this motion to the current position of
each vertex
and after adjusting some of these values
I got this bleeding shield which is
really cool I could make it look a
little bit bouncy if I wanted
but breathing is exactly what I wanted
so for now it was looking good and I was
able to move on to the next step
which was adding the ripples for when
something hits the shield and this part
requires a bit more patience and try and
fail to be fair but add this idea in
mind that I use its fear collided to get
the hit point and past that position to
his fear masking shader I could get the
F that I wanted so that's where I
started I added the sphere collide to
the shader and a rigidbody too
then I duplicated the shader so I could
run some tests without interfering with
the original one
so first I got rid of to Fresno because
it's not necessary for this but
essentially this awesome effect only
requires a sphere mask node and this
node requires the coordinate system
input basically what is the sphere space
is it local or is it world position so I
assign it the world position vector then
I was able to control the sphere radius
and the fate of the sphere or the
oddness or the smoothness call it
whatever you want and the most important
part is this last pair entered the
sphere center for this I created a
vector tree that I will control via
scripts which means this allowed me to
set the sphere center to the hit point
which is awesome
so I duplicated the shield made sure it
did loop and it only leave it for one
second for now and also add the fade-out
in the color of lifetime
add the material with the share that
contains the sphere mask
and this is how it was looking basically
if I move the center basically if I move
the sphere Center we can see the sphere
mask in action which is really cool we
can see that it fades and it has this
really nice touch I was also able to
decrease the sphere arnaz and sphere
radius as well and gave it this orange
color too
really cool stuff actually
for the next part I created the script
to detect collisions on the sphere
Collider so I coded this very basic
script that detects if something with a
bullet tag hits the collider if so its
bounds the ripples and this is the most
important line it's line that
communicates with the shader and tells
what is the sphere center
but I needed to rename the sphere center
property reference in shadowgraph
so the script could detect it
and to quickly test this out I created a
sphere with a color header a rigidbody
and set the tag to bullet and at this
point it was already looking pretty cool
and it worked like a charm every time
the sphere collides with the shield it
will spawn the ripples basically
and for the final touches all I had to
do was add a few more particle systems
so it becomes even more interesting for
example like a flash of light a
shockwave on the ground as well
another shockwave in the middle why not
a few trails to the shield mesh with the
shield texture with a basic additive
shader a few circles on the ground as if
the shield was emitting those little
shock waves and these excellent and
pentagons part costume
and a few more Fink's in the end and if
you want to learn more about particle
systems and effects in unity I have a
lot of tutorials on my channel and I
also have a udemy course where I'll talk
about this subject extensively and in an
organized manner
I left links in description and in
comments as well in case you want to
check that out now for the shield
lefties motion I use it custom vertex
streams and in case you want to learn
about that too you can check out this
blood to Rio that uses custom vertical
extremes as well as least slash effect
in case you're interested but basically
I am controlling the vertex offset
amount in the particle system with this
curve and that's what gives this
breathing feeling at the end I also
added a noise texture to distort a
little bit the motion of the vertex
awesome so it creates this glitchy thing
in the beginning I think it adds a
really nice touch and then I made a few
more adjustments and this is how it's
good
[Music]
and honestly I think it turned out
pretty solid a very cool effect and I
had a lot of fun creating this well by
the way if you want to know how to
project us I also left a link in
description for a tutorial that may help
you so that's it guys here's another
example of cool stuff that you can do
with your graph this project is a very
my patreon page as well as many other
shaders and the effects that I have done
links inscription in case you were
interested and I want to thank every
patron that supports me
these videos will be a lot harder to
make if I didn't have your support and I
want to say a special thank you to super
mega patrons which are CJ goblin black
green fast data hiker cap King James
Finley true Amendola mark Britain and
Nicholas J Ramya worden studios Ravi
Aaron Guin and yoni and as always I am
very sorry for any of your names wrong
you guys are amazing and your sport
means truly a lot and thanks everyone
for watching this video I hope to see
you in the next one
[Music]